package com.maimao.info.controller;

import com.maimao.api.mall.info.AddressApi;
import com.maimao.core.model.auth.AuthUser;
import com.maimao.core.model.resp.Result;
import com.maimao.info.controller.base.BaseController;
import com.maimao.info.service.AddressService;
import com.maimao.info.service.RegionService;
import com.maimao.model.info.Address;
import com.maimao.model.info.Region;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 全国地区
 *
 * @author MaoLin Wang
 * @date 2021/1/13 2:21 下午
 */
@RestController
@RequestMapping("/info/region")
public class RegionController extends BaseController {

    @Autowired
    private RegionService regionService;

    @GetMapping("/tree")
    public Result<?> treeData() {
        return Result.okData(regionService.regionTree());
    }

}
